﻿<UserControl x:Class="Toon.Controls.CharacterSheet"

             
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:System="clr-namespace:System;assembly=mscorlib" 
	xmlns:local="clr-namespace:Toon.Controls"
    xmlns:models="clr-namespace:Toon.Models.Characters;assembly=Toon.Models"
	mc:Ignorable="d" 
	d:DataContext="{d:DesignInstance Type=models:Character, IsDesignTimeCreatable=True}"
             
    d:DesignHeight="300" d:DesignWidth="400">

    <DockPanel x:Name="LayoutRoot" Margin="20" LastChildFill="False">

        <local:VerticalStackingPanel DockPanel.Dock="Top" >
            <local:VerticalStackingPanel.Resources>
                <Style TargetType="local:LabeledTextBlock">
                    <Setter Property="LabelStyle">
                        <Setter.Value>
                            <Style TargetType="Label">
                                <Setter Property="FontFamily" Value="Times New Roman"/>
                                <Setter Property="FontSize" Value="20" />
                            </Style>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="TextStyle">
                        <Setter.Value>
                            <Style TargetType="TextBlock">
                                <Setter Property="FontFamily" Value="Comic Sans MS"/>
                                <Setter Property="FontSize" Value="16" />
                            </Style>
                        </Setter.Value>
                    </Setter>
                </Style>
            </local:VerticalStackingPanel.Resources>

            <Image Stretch="Uniform" MaxWidth="250" Source="/Toon;component/Assets/Toon-Banner.png" />
            <TextBlock FontSize="30" HorizontalAlignment="Center" FontFamily="Times New Roman" Text="Character Sheet"  />


            <Border BorderThickness="3" BorderBrush="Black" MinWidth="300" Margin="10">
                <Grid>
                    <Grid.Resources>
                        <Style TargetType="TextBlock" x:Key="BoxTitle">
                            <Setter Property="FontFamily" Value="Times New Roman" />
                            <Setter Property="FontSize" Value="20" />
                        </Style>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="75" />
                        <RowDefinition Height="75" />
                        <RowDefinition Height="Auto" MinHeight="100" />
                    </Grid.RowDefinitions>

                    <Border BorderThickness="0,0,0,3" BorderBrush="Black">
                        <StackPanel Margin="5" Orientation="Horizontal" VerticalAlignment="Top">
                            <TextBlock Text="Hit Points" Style="{StaticResource BoxTitle}" VerticalAlignment="Center" />
                            <TextBlock FontSize="20" Text="{Binding HitPoints}" Margin="5,0,0,0" VerticalAlignment="Center" />
                        </StackPanel>
                    </Border>
                    <Border Grid.Row="1" BorderThickness="0,0,0,3" BorderBrush="Black">
                        <TextBlock  Margin="5" Text="Plot Points" Style="{StaticResource BoxTitle}" />
                    </Border>
                    <Border Grid.Row="2" >
                        <local:DetailRegion Margin="5" Click="Description_Click" >
                            <StackPanel>
                                <TextBlock Text="Description" Style="{StaticResource BoxTitle}" />
                                <TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
                            </StackPanel>
                        </local:DetailRegion>
                    </Border>


                    <Border Grid.Column="1" Grid.RowSpan="3" BorderThickness="3,0,0,0" BorderBrush="Black">
                        <local:DetailRegion Margin="5">
                            <TextBlock Text="Picture" Style="{StaticResource BoxTitle}" />
                        </local:DetailRegion>
                    </Border>




                </Grid>
            </Border>



            <local:DetailRegion Click="Name_Click">
                <local:LabeledTextBlock Text="{Binding Name}" LabelContent="Name:"/>
            </local:DetailRegion>

            <local:DetailRegion Click="Species_Click">
                <local:LabeledTextBlock Text="{Binding Species}" LabelContent="Species:"/>
            </local:DetailRegion>

            <local:DetailRegion Click="NaturalEnemies_Click">
                <local:LabeledTextBlock Text="{Binding NaturalEnemies}" LabelContent="Natural Enemies:"/>
            </local:DetailRegion>

            <local:DetailRegion Click="BeliefsAndGoals_Click">
                <local:LabeledTextBlock Text="{Binding BeliefsAndGoals}" LabelContent="Beliefs &amp; Goals:"/>
            </local:DetailRegion>

            <local:DetailRegion Click="Occupation_Click">
                <local:LabeledTextBlock Text="{Binding Occupation}" LabelContent="Occupation:"/>
            </local:DetailRegion>

            <local:LabeledTextBlock Text="{Binding Speed}" LabelContent="Speed:"/>





        </local:VerticalStackingPanel>

        <StackPanel DockPanel.Dock="Left" Name="EditableAttributesA" >
            <local:DetailRegion DataContext="{Binding Attributes[Muscle]}" Click="Attribute_Click" >
                <local:AttributeControl />
            </local:DetailRegion>

            <local:DetailRegion DataContext="{Binding Attributes[Zip]}" Click="Attribute_Click">
                <local:AttributeControl />
            </local:DetailRegion>


        </StackPanel>

        <StackPanel DockPanel.Dock="Left" Name="EditableAttributesB">


            <local:DetailRegion DataContext="{Binding Attributes[Smarts]}" Click="Attribute_Click">
                <local:AttributeControl />
            </local:DetailRegion>

            <local:DetailRegion DataContext="{Binding Attributes[Chutzpah]}" Click="Attribute_Click">
                <local:AttributeControl />
            </local:DetailRegion>

        </StackPanel>


        <StackPanel DockPanel.Dock="Left" Name="PrintableAttributes" Visibility="Collapsed">
            <local:DetailRegion DataContext="{Binding Attributes[Muscle]}" Click="Attribute_Click" >
                <local:AttributeControl />
            </local:DetailRegion>

            <local:DetailRegion DataContext="{Binding Attributes[Zip]}" Click="Attribute_Click">
                <local:AttributeControl />
            </local:DetailRegion>

            <local:DetailRegion DataContext="{Binding Attributes[Smarts]}" Click="Attribute_Click">
                <local:AttributeControl />
            </local:DetailRegion>

            <local:DetailRegion DataContext="{Binding Attributes[Chutzpah]}" Click="Attribute_Click">
                <local:AttributeControl />
            </local:DetailRegion>

        </StackPanel>

        <StackPanel DockPanel.Dock="Left">

            <local:DetailRegion Click="Shitcks_Click">
                <DockPanel>

                    <StackPanel Margin="5" Width="120" DockPanel.Dock="Left">
                        <TextBlock FontSize="20" Text="Shitcks" HorizontalAlignment="Center" />
                    </StackPanel>

                    <ItemsControl ItemsSource="{Binding Shitcks}" Grid.Column="1" Margin="5">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <StackPanel.Resources>
                                            <Style TargetType="TextBlock">
                                                <Setter Property="FontSize" Value="14" />
                                            </Style>
                                        </StackPanel.Resources>

                                        <TextBlock Text="{Binding Name}" Margin="0,0,5,0" />
                                        <TextBlock Text="{Binding SkillLevel}"/>
                                    </StackPanel>
                                    <TextBlock Text="{Binding BookLocation}" FontSize="10" />
                                    <TextBlock Text="{Binding Notes}" FontStyle="Italic"  FontSize="10" />
                                    <TextBlock Text="{Binding TweakPoints, StringFormat='Personalized cost {0}'}" FontSize="10"
												   Visibility="{Binding TweakPoints, Converter={StaticResource NotZeroToVisibleConverter}}"
												   />

                                </StackPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </DockPanel>
            </local:DetailRegion>

            <local:DetailRegion Margin="5" Click="Possessions_Click" >
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <StackPanel>
                        <TextBlock FontSize="20" Text="Possessions" HorizontalAlignment="Center" />
                        <TextBlock Text="* Unusual Item" Grid.Row="2" HorizontalAlignment="Center"/>
                    </StackPanel>

                    <ItemsControl Grid.Row="1" ItemsSource="{Binding Possessions}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Name}" />
                                        <TextBlock Text="*" Visibility="{Binding Type, Converter={StaticResource UnusualItem}}" />
                                    </StackPanel>
                                    <TextBlock Margin="4,0,0,0" FontStyle="Italic" TextWrapping="Wrap" Text="{Binding Notes}" Visibility="{Binding Notes, Converter={StaticResource NotZeroToVisibleConverter}}" />
                                </StackPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>

                </Grid>
            </local:DetailRegion>

        </StackPanel>

    </DockPanel>

</UserControl>
